<!DOCTYPE html>
<#assign ctx=Session.basePath>
<html>
<head>
    <meta http-equiv="refresh" content="text/html; charset=utf-8" />
    <title>添加列表</title>
    <link href="${ctx}/easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <link href="${ctx}/easyui/themes/icon.css" rel="stylesheet" />
    <script src="${ctx}/easyui/jquery.easyui.min.js"></script>
    <script src="${ctx}/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<script>
    $(".btn-search").click(function () {
        var gzname = $("#gzname").val();
        if(gzname == null||gzname==""){
            layer.alert("必填项不可为空！");
        return;
    }
    $.ajax({
        url:"${ctx}/ship/guanzhu/insertGZ?gzname="+gzname,
        type:"POST",
        success:function (data) {
            if(data){
                layer.alert("添加成功！");
                window.parent.layer.closeAll();
            }else{
                layer.alert("名称已存在！");
            }
        }
    })

    })
</script>
<body>
    <table>
        <div>
        <tr>
            <td>请输入列表名：</td>
            <td><input id="gzname" class="easyui-textbox" type="text" name="name" data-options="required:true"/></td>
        </tr>
        </div>
        <div>
        <tr>
            <td><a href="#" class="easyui-linkbutton btn-search" iconCls="icon-ok" style="width:100%;height:32px">添加</a></td>
        </tr>
        </div>
    </table>
</body>
</html>
